Five-dimensional rasterization with conservative bounds

ABSTRACT

A per-tile test in the 5D rasterizer outputs intervals for both lens parameters, (u,v), and for time, t, as well as for depth z. These intervals are conservative bounds for the current tile for 1) the visible lens region, 2) the time the triangle overlaps the tile, and 3) the depth range for the triangle inside the tile.

BACKGROUND

This relates to graphics processing and particularly to the graphical depiction of motion blur.

Motion blur is an important visual effect that reduces temporal aliasing and makes moving content appear smoother. However, efficient rendering of motion blur in real-time three-dimensional graphics is nontrivial. In stochastic rasterization of motion blur, moving geometric primitives are sampled in both space and time, using a large set of samples to obtain high-quality motion-blurred images with low noise levels. For each of the sample positions, an inside test is executed to determine whether the moving primitive covers the sample. This overlap test in x, y and t space is generally more expensive than an inside test in traditional rasterizers.

A stochastic rasterizer that supports simultaneous motion blur and depth of field executes visibility tests for each triangle in a five dimensional (5D) domain (x,y,u,v,t). This domain consists of spatial positions (x,y), lens coordinates (u,v) and time t. These visibility tests are computationally much more expensive than a single visibility test in standard 2D rasterization. Additionally, for each triangle, many (e.g. 16-64) such tests are executed per pixel to obtain images with low noise levels.

Five-dimensional (5D) rasterization is expected to become part of DirectX and OpenGL at some point in the future. This will enable us to render images with accurate and correct depth of field and motion blur.

BRIEF DESCRIPTION OF THE DRAWINGS

Some embodiments are described with respect to the following figures:

FIG. 1 is a screen shot from an interactive visualizer according to one embodiment;

FIG. 2 is a depiction of the construction of a moving axis-aligned bounding box according to one embodiment;

FIG. 3 is a flow chart for one embodiment; and

FIG. 4 is a schematic depiction for one embodiment.

DETAILED DESCRIPTION

A per-tile test in the 5D rasterizer outputs intervals for both lens parameters, (u,v), and for time, t, as well as for depth z. These intervals are conservative bounds for the current tile for 1) the visible lens region, 2) the time the triangle overlaps the tile, and 3) the depth range for the triangle inside the tile.

This output can be sent (when needed) further down the graphics pipeline to the pixel shader, and used for various things by the application developer. The interesting thing is that this results in a conservative 5D rasterizer. Previously, we have only had access to conservative 2D rasterization. This invention extends this to a whole new domain and, as a starting point, we have discovered that conservative 5D rasterization with such outputs can be used for dynamic collision detection and caustics rendering on the graphics processor. Dynamic collision detection on the graphics processor has not been done before, as far as we know, and the caustics rendering solution that we have thought of will be more efficient than previous methods.

In addition, we present a new way to compute a conservative depth interval over a moving triangle. This makes occlusion culling more efficient, and saves both computer resources, as well as memory bandwidth usage in some embodiments.

We present a method for computing conservative depth over a motion blurred triangle over a tile of pixels. This is useful for occlusion culling (z_(min)/z_(max)-culling) and conservative rasterization, as well as a number of other techniques, such as dynamic collision detection on the graphics processor, and caustics rendering.

Usually, a moving vertex is described by p_(i)=(1−t)q_(i)+tr_(i), t ε [0,1], and a moving triangle is described by p₀p₁p₂. Hence, we have a triangle q₀q₁q₂ at t=0 and r₀r₁r₂ at t=1.

We assume that points, e.g., p, are two-dimensional homogeneous coordinates, i.e., p=(p_(x),p_(y),p_(w)). We derive conservative depth in terms of the w-coordinate. Later, we show how the desired normalized depth, z/w, can be computed only from knowing the value of w, when standard projection matrices of OpenGL and DirectX are used.

We will present two ways to compute conservative depth over a tile (e.g., a block of pixels). The power of these two methods may be combined, resulting in a tighter conservative depth in some embodiments.

A plane equation is computed through the triangle at time t=0 (t=1). That plane is moved with constant speed as a function of time, such that it always has the moving triangle on one side of the plane. In the following, we will describe how we compute a moving plane equation which has larger depth than the moving triangle. Hence, this is useful for computing maximum depth (w_(max) ^(tri)). Similar techniques can be used to compute minimum depth (w_(min) ^(tri)).

First, we compute the static plane equation of the triangle at t=0. The plane normal is given by: n ₀=(q ₂ −q ₀)×(q ₁ −q ₀).  (1)

To make sure we move the plane in the right direction, we negate n₀ if n_(0w)<0. The plane equation is then: π_(o): n₀·o+d₀, where d₀=n₀·q₀, and o is an arbitrary point on the plane. Next, we compute the velocity v₀.

$\begin{matrix} {{v_{0} = {- {\max\limits_{i}\left( {{n_{0} \cdot r_{i}} + d_{0}} \right)}}},{i \in \left\{ {0,1,2} \right\}},} & (2) \end{matrix}$ which is the maximum signed distance from the plane, π₀, over the vertices of the moving triangle at t=1. At this point, we have created a moving plane equation, which moves in the direction of the plane normal: Π₀(t):n ₀ ·o+d ₀ +v ₀ t=0.  (3)

As can be seen, we have added the term v₀t, which ensures (by construction) that the triangle is “below” the moving plane equation, Π₀(t). If Π₀(t) does not sweep through the camera origin, e.g. d ₀ +v ₀ t≠0•tε[0,1],  (4) then Π₀(t) has greater depth than the moving triangle at all times, t ε [0,1]. Any ray from the camera that intersects the triangle will intersect the triangle before intersecting the plane.

Sometimes, the plane equation of the triangle at t=1 provides a better plane equation to work with. In fact, in most cases, the triangle plane at t=0 is better in the beginning, and towards the end of the time interval, the triangle plane at t=1 is better. Hence, we want to derive a way of using the plane equation at t=1 as well.

The plane normal at t=1 is: n ₁=(r ₂ −r ₀)×(r ₁ −r ₀).  (5) Again, we negate n₁ if n_(1w)<0. To make sure that the triangle at t=0 is on the right side of the new plane equation (with n₁ as normal), we need to compute the dot products between the normal, n₁, and the vertices of the triangle at t=0 in order to compute d₁:

$\begin{matrix} {{d_{1} = {\min\limits_{i}\left( {{- n_{1}} \cdot q_{i}} \right)}},{i \in {\left\{ {0,1,2} \right\}.}}} & (6) \end{matrix}$

The plane equation is then: π₁:n₁·o+d₁. The velocity, v₁, of the moving plane is computed in the same way as above:

$\begin{matrix} {{v_{1} = {- {\max\limits_{i}\left( {{n_{1} \cdot r_{i}} + d_{1}} \right)}}},{i \in {\left\{ {0,1,2} \right\}.}}} & (7) \end{matrix}$

The moving plane equation becomes: Π₁(t):n ₁ ·o+d ₁ +v ₁ t=0.  (8)

Again, we also test for overlap between Π₁(t) and the camera origin d₁+v₁t≠0 ∀t ε [0,1] to ensure that the plane is a conservative approximation of w_(max) ^(tri).

At this point, we have two plane equations, Π₀ and Π₁, which move at constant velocities, and the next step is to evaluate the depth of these moving plane equations over a tile. The depth at a tile corner, (x, y), is computed as:

$\begin{matrix} {{w_{i}\left( {x,y,t} \right)} = {- {\frac{d_{i} + {v_{i}t}}{n_{i} \cdot \left( {x,y,1} \right)}.}}} & (9) \end{matrix}$ Note that when the denominator becomes zero, the plane of the triangle goes through the view point, and we simply do not use such planes when computing conservative depth.

The correct way to compute conservative maximum depth over a tile with four corners is then to take the maximum depth of eight locations, (x, y, t), namely, each of the four tile corners, but also both at time t=0 and t=1. However, since the equation was designed to be efficient to evaluate, it suffices to evaluate the depth at one location. This is described next. If v_(i)>0, we only need to evaluate depth at t=1, and vice versa. The sign of the x- and y-components of the normal is used to select one corner out of the remaining four. For example, if n_(x)>0 and n_(y)<0, we would pick the one of the left corners of the tile (since n_(x)>0), and out of those two, we would select the topmost corner (since n_(y)<0). This makes it all very efficient.

For each moving plane, Π₀ and Π₁, we generate one maximum depth-value, say, w₀ ^(Π) and w₁ ^(Π), using the technique described above. The tightest w_(max) ^(tri) depth over the tile is then selected as the minimum of these: w _(max) ^(Π)=min(w ₀ ^(Π) ,w ₁ ^(Π)).  (10) and similar computations are done to calculate w_(min) ^(Π).

Note that we can use a further optimization if we use a rasterizer that visits tiles and computes time intervals {circumflex over (t)}=[t,t], indicating that there is the possibility that the tile overlaps with the moving triangle. Instead of evaluating Π₀ and Π₁ at t=0 and t=1 as described above, we evaluate at t=t and t=t.

In FIG. 1, we have interpolated the triangle to t=0.5, which is located in the middle between t=0 and t=1. The grids A and B show the two planes, Π₀ and Π₁ at t=0.5. In this case, both lie above the interpolated triangle. The axis C is the w-axis.

As seen in FIG. 2, we construct a moving axis-aligned bounding box (AABB) for the triangle by interpolating its AABB's between times t=0 and t=1. For the closest and farthest quadrilateral faces of the AABB, we compute the intersection times {circumflex over (t)}_(i)=[t,t] with the planes π_(i) of the tile frustum. The tile frustum planes pass through the origin and are aligned to the sides of the tile.

Given a moving vertex of the farthest quadrilateral face, p_(n)=(1−t)q_(n)+tr_(n), the times at which the AABB's intersect with the tile frustum planes n_(i)·p_(n)=0, are given by:

$\begin{matrix} {t = {\frac{n_{i} \cdot q_{n}}{n_{i} \cdot \left( {q_{n} - r_{n}} \right)}.}} & (11) \end{matrix}$ Of the four moving vertices of a quadrilateral face, we select the one that is farthest from π_(i) in the negative direction.

Subsequently, w_(max) is calculated for [t,t] as (shown here for t): w _(max)=(1−t )w _(max) ^(t=0) +tw _(max) ^(t=1)  (12) and similarly for w _(max). Then, the final maximum value using this technique is computed as: w _(max)=max( w _(max) ,w _(max)).  (13)

Analogous computations would be done to compute the minimum depth, and then w_(min)=min(w _(min),w _(min)). Note that this procedure has to be performed for both the x and y tile directions.

An alternative is to calculate the times {circumflex over (t)}_(i)=[t,t] when the moving AABB intersects the tile frustum planes using the n-vertices, and use these times to calculate w_({mim,max}) for t and t. These bounds on depth would however be slightly more conservative than when using the closest and farthest quadrilateral faces.

Up until now, our formulae have computed depth in w, but for OpenGL and DirectX, we usually need the normalized depth: z/w. Given a point, p, in eye space, we can apply standard projection matrices from DirectX. The z and w after projection are expressed as: z=ap _(z) +bp _(w) =ap _(z) +b  (14) w=p _(z), where

$a = \frac{Z_{far}}{Z_{far} - Z_{near}}$ and b=−aZ_(near), a, b>0. In all our derivations, we have computed w (=p_(z)), and as a consequence, we can compute z=aw+b. This in turns means that, given w, we can compute the desired normalized depth, z/w, as z/w=(aw+b)/w.

Note that w(t) and

$\frac{z(t)}{w(t)} = {a + \frac{b}{w(t)}}$ have local minima at the same t only if w(t)≠0 ∀t ε [0,1], as

$a + \frac{b}{w(t)}$ with b>0 is strictly increasing as a function of w for w≠0.

If we compute a maximum normalized depth, Z_(max) ^(I)=z_(max) ^(I)/w_(max) ^(I), using one technique (e.g., using Equation (11)), and another maximum normalized depth, Z_(max) ^(II)=z_(max) ^(II)/w_(max) ^(II) (e.g., using Equation (14)), then we can compute the combined “best” depth as the minimum of the two: Z _(max) ^(best)=min(Z _(max) ^(I) ,Z _(max) ^(II)),  (15) and vice versa for Z_(min) ^(best). This applies to any number of argument to the min-function as long as the parameters represent conservative depths.

This work may be extended to depth of field. Equation (9) can suddenly become zero for many more cases due to that we now have a lens with finite extents to handle. Detecting whether a triangle plane intersects with a convex polygonal lens can be done by computing signed distances from the lens vertices to the plane equation. If there is at least one with positive and one with negative distance, then the plane intersects the lens, and we simply disable the usage of that plane. We can also use a bounding box around the lens shape and use the vertices of the bounding box for the computations described just above.

If the plane does not intersect the lens, we need to compute the depth through the tile corners. However, instead of starting the computations from the origin (where the pinhole camera is assumed to be located), we need to do this for all four corners of the bounding box of the lens shape.

Also, we can also use information from the tile-visiting rasterizer, {circumflex over (t)}, and use that to tighten the conservative depth further.

In accordance with some embodiments, a sequence 10 shown in FIG. 3 may be implemented in software, firmware and/or hardware. In software and firmware embodiments it may be implemented by computer executed instructions stored in a non-transitory computer readable medium such as optical, magnetic or semiconductor storage.

In one embodiment, the sequence of FIG. 3 begins with a triangle set-up stage 12. The per-triangle constants needed for bounding are computed. Next a tile test 14 is performed. In the tile test, u, v, t and z intervals are computed for each tile. A tile is rejected if it is outside the valid range in any of the intervals. Then the u, v and t intervals are used to reject individual samples as shown in block 16. Finally, in the pixel shader, block 18, the u, v, t and z intervals are made available for the pixel shader. This allows for new algorithms in the pixel shader such as caustics rendering and dynamic collision detection.

The computer system 130, shown in FIG. 4, may include a hard drive 134 and a removable medium 136, coupled by a bus 104 to a chipset core logic 110. The computer system may be any computer system, including a smart mobile device, such as a smart phone, tablet, or a mobile Internet device. A keyboard and mouse 120, or other conventional components, may be coupled to the chipset core logic via bus 108. The core logic may couple to the graphics processor 112, via a bus 105, and the central processor 100 in one embodiment. The graphics processor 112 may also be coupled by a bus 106 to a frame buffer 114. The frame buffer 114 may be coupled by a bus 107 to a display screen 118. In one embodiment, a graphics processor 112 may be a multi-threaded, multi-core parallel processor using single instruction multiple data (SIMD) architecture.

In the case of a software implementation, the pertinent code may be stored in any suitable semiconductor, magnetic, or optical memory, including the main memory 132 (as indicated at 139) or any available memory within the graphics processor. Thus, in one embodiment, the code to perform the sequences of FIG. 5 or 6 may be stored in a non-transitory machine or computer readable medium, such as the memory 132, and/or the graphics processor 112, and/or the central processor 100 and may be executed by the processor 100 and/or the graphics processor 112 in one embodiment.

FIG. 3 is a flow chart. In some embodiments, the sequences depicted in these flow charts may be implemented in hardware, software, or firmware. In a software embodiment, a non-transitory computer readable medium, such as a semiconductor memory, a magnetic memory, or an optical memory may be used to store instructions and may be executed by a processor to implement the sequences shown in FIG. 3.

The graphics processing techniques described herein may be implemented in various hardware architectures. For example, graphics functionality may be integrated within a chipset. Alternatively, a discrete graphics processor may be used. As still another embodiment, the graphics functions may be implemented by a general purpose processor, including a multicore processor.

References throughout this specification to “one embodiment” or “an embodiment” mean that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one implementation encompassed within the present invention. Thus, appearances of the phrase “one embodiment” or “in an embodiment” are not necessarily referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be instituted in other suitable forms other than the particular embodiment illustrated and all such forms may be encompassed within the claims of the present application.

While the present invention has been described with respect to a limited number of embodiments, those skilled in the art will appreciate numerous modifications and variations therefrom. It is intended that the appended claims cover all such modifications and variations as fall within the true spirit and scope of this present invention. 

What is claimed is:
 1. A method comprising: computing depth intervals, using a moving plane equation having a depth greater than that of a moving and defocused triangle, for a plurality of tiles for said moving and defocused triangle; rejecting a tile if it is outside a valid range in a depth interval; and rendering an image without said one or more rejected tiles determined from said computed depth intervals for a graphic processor to obtain high quality motion-blurred images.
 2. The method of claim 1 including computing depth intervals valid for a time interval for said tiles.
 3. The method of claim 1 including computing depth intervals valid within a region of lens coordinates for said tiles.
 4. The method of claim 3 including rejecting a tile if it is outside said depth intervals.
 5. The method of claim 4 including rejecting individual samples using said depth intervals.
 6. The method of claim 5 including using said depth intervals for pixel shading.
 7. The method of claim 1 including computing per triangle constants for bounding.
 8. The method of claim 7 including using said constants for computing said depth intervals.
 9. A non-transitory computer readable medium storing instructions to enable a processor to perform the steps of: computing depth intervals, using a moving plane equation having a depth greater than that of a moving and defocused triangle, for a plurality of tiles for said moving and defocused triangle; rejecting a tile if it is outside a valid range in a depth interval; and rendering an image without said one or more rejected tiles determined from said computed depth intervals for a graphics processor to obtain high quality motion-blurred images.
 10. The medium of claim 9 including computing depth intervals valid for a time interval for said tiles.
 11. The medium of claim 9 including computing depth intervals valid within a region of lens coordinates for said tiles.
 12. The medium of claim 11 including rejecting a tile if it is outside said depth intervals.
 13. The medium of claim 12 including rejecting individual samples using said depth intervals.
 14. The medium of claim 13 including using said depth intervals for pixel shading.
 15. The medium of claim 9 including computing per triangle constants for bounding.
 16. The medium of claim 15 including using said constants for computing said depth intervals.
 17. An apparatus comprising: a processor to compute depth intervals using a moving plane equation having a depth greater than that of a moving and defocused triangle for a plurality of tiles for said moving and defocused triangle, reject one or more tiles if the one or more tiles are outside a valid range in a depth interval and render an image without said one or more rejected tiles determined from said computed depth intervals for a graphics processor to obtain high quality motion-blurred images; and a memory coupled to said processor.
 18. The apparatus of claim 17, said processor to compute depth intervals valid for a time interval for said tiles.
 19. The apparatus of claim 17, said processor to compute depth intervals valid within a region of lens coordinates for said tiles.
 20. The apparatus of claim 19, said processor to reject a tile if it is outside said depth intervals.
 21. The apparatus of claim 20, said processor to reject individual samples using said depth intervals.
 22. The apparatus of claim 21, said processor to use said depth intervals for pixel shading.
 23. The apparatus of claim 17, said processor to compute per triangle constants for bounding.
 24. The apparatus of claim 23, said processor to use said constants for computing said depth intervals.
 25. The apparatus of claim 17 wherein said processor is a graphics processing unit. 